Skip to content

Conversation

Tim-Brooks
Copy link
Contributor

This commit adds the logic to delegate bulk shard requests to the split
target when a primary receives a request from a stale coordinator.

ankikuma and others added 28 commits September 17, 2025 17:13
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass

merged
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass

pull
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass

Pull
…com:ankikuma/elasticsearch into ankikuma-09162025/ReshardSplitRequestOnSourceTwoPass
@Tim-Brooks Tim-Brooks added >non-issue :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. labels Oct 9, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Oct 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Oct 9, 2025
@ankikuma
Copy link
Contributor

LGTM

Copy link
Contributor

@bcully bcully left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I had a few questions/suggestions but nothing major. We probably want some more end-to-end ITs when this lands.

}
}
BulkShardResponse bulkShardResponse = new BulkShardResponse(originalRequest.shardId(), bulkItemResponses);
// TODO: Decide how to handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you looked at consumers of this? If so could you leave a breadcrumb to your investigation? If not, we should ticket that and link the ticket here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new ShardId(index, newShardId),
shardNum -> new ArrayList<>()
);
shardRequests.add(new BulkItemRequest(bulkItemRequest.id(), bulkItemRequest.request()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we assert anything about the shard id in bulkItemRequest.request()? From skimming code I think it's probably null (thin serialization) but I don't know if it always is, or how it would be used if it's not null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
return indexShard(indexRequest);
} else if (addIdWithRoutingHash) {
// TODO: is this correct?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're probably going to have to generate test cases for tsdb/logsdb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tim-Brooks Tim-Brooks removed the serverless-linked Added by automation, don't add manually label Oct 16, 2025
@Tim-Brooks Tim-Brooks merged commit e22e908 into elastic:main Oct 16, 2025
34 checks passed
Kubik42 pushed a commit to Kubik42/elasticsearch that referenced this pull request Oct 16, 2025
This commit adds the logic to delegate bulk shard requests to the split
target when a primary receives a request from a stale coordinator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >non-issue Team:Distributed Indexing Meta label for Distributed Indexing team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants